import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';
import nodejs from '@dfeidao/atom-web/msg/nodejs';
import render from '@dfeidao/atom-web/render/render';
import p001 from './p001';

export default async function a001(fd: IFeidaoAiBrowserComponent) {// 搜索
	// todo
	console.log('zj-000003:a001------start');
	// 获取隐患源特性名称
	const n = fd.data.node.querySelector<HTMLInputElement>('[data-id="hidden_name"]');// 获取输入查询的内容
	const v = n.value;
	console.log(v);
	// 搜索
	const res = await nodejs<{ res: Array<{}>; c: number }>('wyf-hManager/zj-000003/s001', {
		filter: {
			hidden_name: v,
			pn: 1
		}
	});
	console.log(res);
	render(fd, res, p001, 'p001', 'inner');

	console.log('zj-000003:a001------end');
}
